<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.bootcss.com/vue/2.6.11/vue.js"></script>
    <style>
        * {
            margin: 0;
            padding: 0;
            list-style: none;
        }

        [v-cloak] {
            display: none;
        }
    </style>
</head>

<body>
    <div id="app" v-cloak>
        <div v-for="(item,i) in userlist" :key="item.id">
            <input type="text">
            <button @click="remove(i)">删除</button>
        </div>


    </div>

    </div>
    <script>
        console.log()


        new Vue({
            el: "#app",
            data() {
                return {
                    userlist: Array.from({
                        length: 4
                    }).map((r, i) => ({
                        id: +new Date() +i,
                        val: ""
                    }))
                }
            },
            methods: {
                remove(i) {
                    this.userlist.splice(i, 1)
                }
            },

        })
    </script>

    <style>

    </style>

</body>

</html>